package edu.chalmers.AV_2DPlatformerMyGame.Model;

import edu.chalmers.AV_2DPlatformerFramework.Model.GameObject;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox;
import edu.chalmers.AV_2DPlatformerFramework.Model.Texture;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;

/**
 * @version 0.1
 * @author Andrea Buchholz
 */
public class Object_Edmund extends GameObject{

    public Object_Edmund() throws Hitbox.HitboxMalformedException {
        super(null);

        Vector2D[] vertices = {new Vector2D(0, 0), new Vector2D(80, 0), 
            new Vector2D(80, 100), new Vector2D(0, 100)};
        
        // Not finished
        // Defining a more accurate hitbox for Edmund.
        //Vector2D[] vertices = {new Vector2D(30, 0), new Vector2D(0,40),new Vector2D(60, 0), 
        //    new Vector2D(0, 80), new Vector2D(60, 80), new Vector2D(30,100), new Vector2D(80,100)};
        
        
        this.setHitbox(new Hitbox(vertices));
        String s = System.getProperty("file.separator");
        this.addTexture(
                new Texture("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"EdmundRight.png", this.getHitbox().getBounds2D()));
        // Not finished
        // Adding another texture for Edmund, dependent on direction.
        //        this.addTexture(
//                new Texture("."+s+"src"+s+"main"+s+"java"+s+"TexturesMyGame"
//                        +s+"EdmundLeft.png", this.getHitbox().getBounds2D()));
//       

       
    }
    
    @Override
    public void onCollision(GameObject otherobject) {
    }

    @Override
    public GameObject copy() {
        try {
           Object_Edmund copy = new Object_Edmund();
           this.copyVariablesTo(copy);
           return copy;
        } catch (Hitbox.HitboxMalformedException ex) {
            return null;
        }
    }
}